Shader "GJ/ArrowMove" {
  Properties {
      _Color ("Color", Color) = (0.07843138,0.3921569,0.7843137,1)
      _Color2 ("Color2", Color) = (1,0,0,1)
      _Emission ("Emission", Float ) = 1
      _Step ("Step", Float ) = 4
      _Width ("Width", Range(0, 1)) = 0
      _Percentage ("Percentage", Range(0, 1)) = 0
      [MaterialToggle] _UseTime ("UseTime", Float ) = 0
      _TimeSpeed ("TimeSpeed", Float ) = 0.5
      _BG_Opacity ("BG_Opacity", Range(0, 1)) = 0.1
      [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
  }
  SubShader {
      Tags {
          "IgnoreProjector"="True"
          "Queue"="Transparent"
          "RenderType"="Transparent"
      }
      Pass {
          Blend SrcAlpha OneMinusSrcAlpha
          Cull Off
          ZWrite Off
          
          
          CGPROGRAM
          #pragma vertex vert
          #pragma fragment frag
          #include "UnityCG.cginc"
          #pragma target 2.0
          uniform float4 _Color;
          uniform float _TimeSpeed;
          uniform float _Step;
          uniform float _Width;
          uniform fixed _UseTime;
          uniform float _Percentage;
          uniform float4 _Color2;
          uniform float _Emission;
          uniform float _BG_Opacity;
          struct VertexInput {
              float4 vertex : POSITION;
              float2 texcoord0 : TEXCOORD0;
          };
          struct VertexOutput {
              float4 pos : SV_POSITION;
              float2 uv0 : TEXCOORD0;
          };
          VertexOutput vert (VertexInput v) {
              VertexOutput o = (VertexOutput)0;
              o.uv0 = v.texcoord0;
              o.pos = UnityObjectToClipPos( v.vertex );
              return o;
          }
          float4 frag(VertexOutput i) : COLOR {
////// Lighting:
////// Emissive:
          float node_3053 = ((i.uv0.r - floor(i.uv0.r))*_Step);
          float Step = _Step;
          float3 emissive = (lerp(_Color.rgb,_Color2.rgb,saturate((ceil(node_3053)/Step)))*_Emission);
          float3 finalColor = emissive;
          float node_5626 = step((_Width*0.5+0.5),frac(saturate((abs((i.uv0.g - floor(i.uv0.g)-0.5))+frac(node_3053)))));
          float4 node_7336 = _Time;
          float node_97 = (node_3053-floor(fmod((lerp( min(0.9999,_Percentage), frac((node_7336.g*_TimeSpeed)), _UseTime )*_Step),_Step)));
          float node_8153 = saturate((node_5626*saturate((0.5 - 2.0*(floor(node_97)-0.5)*(ceil(node_97)-0.5)))));
          return fixed4(finalColor,(node_8153+(node_5626*(1.0 - node_8153)*_BG_Opacity)));
          }
          ENDCG
      }
  }
  CustomEditor "ShaderForgeMaterialInspector"
}
